package com.demo.xml_a_constructor;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestCycle {
    //spring工厂
    @Test
    public void test2(){
        String xmlPath="com/demo/xml_a_constructor/beans.xml";
        ApplicationContext classPathXmlApplicationContext=new ClassPathXmlApplicationContext(xmlPath);
        User user = (User) classPathXmlApplicationContext.getBean("userId");
        System.out.println(user);
    }
}
